#ifndef PERLIN_HPP
#define PERLIN_HPP

class Perlin{
	private:
		int octaves_;
		double persistence_;
		double frequency_;
		int seed_;

		//Private subroutine
		inline double scurve(const double a) const;
		inline double noise(
				const int x,
				const int y,
				const int z=0) const;
		double interpolate(
				const double x,
				const double y,
				const double z) const; 
	public:
		// Constructor	
		Perlin(
				int octaves=1,
				double persistence=0.5f,
				double frequency=2.0f,
				int seed=0);
		// Destructor
		~Perlin(void);
		// Main Function
		int Perlini(
				const double x,
				const double y,
				const double z=0.0f) const;

		double Perlinf(
				const double x,
				const double y,
				const double z=0.0f) const;
		// Accessors
		int GetOctaves(void) const;
		double GetPersistence(void) const;
		double GetFrequency(void) const;
		int GetSeed(void) const;
		// Mutators
		void SetOctaves(const int value);
		void SetPersistence(const double value);
		void SetFrequency(const double value);
		void SetSeed(const int value);
};

#endif
